import config from './config';
const http = option => {
	return new Promise((resolve, reject) => {
		uni.request({
			method: option.method,
			url: `${config.APIURL}${option.url}`,
			data: option.data,
			header: {...option.header,
			'content-type':'application/x-www-form-urlencoded'},
			success: res => {
				resolve(res.data);
			},
			fail: err => {
				reject(err.errMsg);
			}
		})
	});
}

export default http;
